Page({

  /**
   * 页面的初始数据
   */
  data: {
    sign: null,
    ispopupShow: false,
    CjstateValue: '',
    CjstateIndex:0,
    ZdstateValue: '',
    ZdstateIndex:0,
    columnsCjState:[{
      id: 0,
      text: '选择区域'
    }, {
      id: 1,
      text: '吴中区'
    }, {
      id: 2,
      text: '相城区'
    }],
    columnsZdState:[{
      id: 0,
      text: '选择基站'
    }, {
      id: 1,
      text: '基站A'
    }, {
      id: 2,
      text: '基站B'
    }],
    customStyleSelect: "padding:0 0 0 20rpx;height: 100%;width:100%;color:#808285;",
    listData:[
      {
        id:1,
        title:'吴中区城南基站A',
        amount:100,
        normal_state:'98%',
        offline_state:'2%',
        protect_state:'100%',
        url_image:'https://img.yzcdn.cn/vant/cat.jpeg'
      },
      {
        id:2,
        title:'吴中区城南基站B',
        amount:100,
        normal_state:'94%',
        offline_state:'6%',
        protect_state:'100%',
        url_image:'https://img.yzcdn.cn/vant/cat.jpeg'
      },
    ]
  },
  onClickInput(e) {
    let that = this
    that.setData({
      sign: e.currentTarget.dataset.sign,
      ispopupShow: true
    })
  },
  cancelpicker(e) {
    let that = this
    that.setData({
      ispopupShow: false
    })
    setTimeout(()=>{
      that.setData({
        sign:null
      })
    },200)
  },
   //层级
   onConfirmCjState(event) {
    let that = this
    that.setData({
      CjstateIndex:event.detail.index,
      CjstateValue: event.detail.value.id == 0 ? '' : event.detail.value.text,
      ispopupShow: false
    })
  },
  //站点选择
  onConfirmZdState(event) {
    let that = this
    that.setData({
      ZdstateIndex:event.detail.index,
      ZdstateValue: event.detail.value.id == 0 ? '' : event.detail.value.text,
      ispopupShow: false
    })
  },
  Querystation() {
    let that = this
    let queryParams = {}
    queryParams.CjstateValue = that.data.CjstateValue
    queryParams.ZdstateValue = that.data.ZdstateValue
    console.log('设备查询',queryParams);
  },
  baseItemHeld(e){
    console.log(e.currentTarget.dataset.id);
    wx.navigateTo({
      url: '/pages/operation/operation?id='+JSON.stringify(e.currentTarget.dataset.id),
    })
  },
  /**
   * 生命周期函数--监听页面加载
   */
  onLoad(options) {
  },

  /**
   * 生命周期函数--监听页面初次渲染完成
   */
  onReady() {

  },

  /**
   * 生命周期函数--监听页面显示
   */
  onShow() {

  },

  /**
   * 生命周期函数--监听页面隐藏
   */
  onHide() {

  },

  /**
   * 生命周期函数--监听页面卸载
   */
  onUnload() {

  },

  /**
   * 页面相关事件处理函数--监听用户下拉动作
   */
  onPullDownRefresh() {

  },

  /**
   * 页面上拉触底事件的处理函数
   */
  onReachBottom() {

  },

  /**
   * 用户点击右上角分享
   */
  onShareAppMessage() {

  }
})